Skip to main content

All Questions

Tagged with
-1votes
5answers
883views

How to make sure that the last character of each line of a file ends with single quote character

I have a file which has several lines. I wish to update the file while making sure that the last visible character of each line of the file is a single quote '. In case not, then we should add the ...
Ashar's user avatar
0votes
1answer
1kviews

How to add single quote at the end of ONLY the last line of a file [duplicate]

I want a non-perl solution where I should be able to append a single quote ' at the last visible (non-escape characters) line of a file and save it back to the file. cat example.txt var1: 'funn' var2: ...
Ashar's user avatar
1vote
1answer
63views

Replacing lines in one file based of indices in a second file

I have two files: Ref.txt which contains: ABCDEFG,15147,1,2,6 HIJKLMN,500,3,4 and Seq.txt which contains: ABCXXXX ABCDEXX IIJKXXX HIHKXXX LMNOPQR BBCDEXX STUVWXY I would like to replace the certain ...
DNA_bash's user avatar
2votes
4answers
3kviews

How to extract columns before and after a string ocurrence

I have a text file. That looks like: www.ac.com has address 6.1.1.146 www.ac.com is an alias for ac.com. www.ac.com is an alias for ac.com. www.ba.net is an alias for www-bn.gs.ba.com. www-bn.gs.ba....
user9371654's user avatar

close